package com.example.demo1109.demo5;

import java.util.ArrayList;

public class FanPublic implements MyPublic{
    private String msg;
    private ArrayList<UserInterface> list= new ArrayList<>();
    @Override
    public void attention(UserInterface userInterface) {
        list.add(userInterface);
    }

    @Override
    public void cancel(UserInterface userInterface) {
        list.remove(userInterface);
    }

    @Override
    public void setMsg(String msg) {
        this.msg=msg;
    }

    @Override
    public void mass() {
        for (UserInterface userInterface : list) {
            userInterface.getMsg(msg);
        }
    }
}
